home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / imgIContainer.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  137 lines

  1. /** -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is mozilla.org code.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 2001
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Stuart Parmenter <pavlov@netscape.com>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  28.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsISupports.idl"
  41. #include "gfxtypes.idl"
  42. #include "gfxIFormats.idl"
  43.  
  44. interface gfxIImageFrame;
  45. interface imgIContainerObserver;
  46.  
  47. /**
  48.  * gfxIImageContainer interface
  49.  *
  50.  * @author Stuart Parmenter <pavlov@netscape.com>
  51.  * @version 0.1
  52.  * @see "gfx2"
  53.  */
  54. [scriptable, uuid(1a6290e6-8285-4e10-963d-d001f8d327b8)]
  55. interface imgIContainer : nsISupports
  56. {
  57.   /**
  58.    * Create a new \a aWidth x \a aHeight sized image container.
  59.    *
  60.    * @param aWidth The width of the container in which all the
  61.    *               gfxIImageFrame children will fit.
  62.    * @param aHeight The height of the container in which all the
  63.    *                gfxIImageFrame children will fit.
  64.    * @param aObserver Observer to send animation notifications to.
  65.    */
  66.   void init(in PRInt32 aWidth,
  67.             in PRInt32 aHeight,
  68.             in imgIContainerObserver aObserver);
  69.  
  70.  
  71.   /* this should probably be on the device context (or equiv) */
  72.   readonly attribute gfx_format preferredAlphaChannelFormat;
  73.  
  74.   /**
  75.    * The width of the container rectangle.
  76.    */
  77.   readonly attribute PRInt32 width;
  78.  
  79.   /**
  80.    * The height of the container rectangle.
  81.    */
  82.   readonly attribute PRInt32 height;
  83.  
  84.  
  85.   /**
  86.    * Get the current frame that would be drawn if the image was to be drawn now
  87.    */
  88.   readonly attribute gfxIImageFrame currentFrame;
  89.  
  90.  
  91.   readonly attribute unsigned long numFrames;
  92.  
  93.   /**
  94.    * Animation mode Constants
  95.    *   0 = normal
  96.    *   1 = don't animate
  97.    *   2 = loop once
  98.    */
  99.   const short kNormalAnimMode   = 0;
  100.   const short kDontAnimMode     = 1;
  101.   const short kLoopOnceAnimMode = 2;
  102.  
  103.   attribute unsigned short animationMode;
  104.  
  105.   gfxIImageFrame getFrameAt(in unsigned long index);
  106.  
  107.   /**
  108.    * Adds \a item to the end of the list of frames.
  109.    * @param item frame to add.
  110.    */
  111.   void appendFrame(in gfxIImageFrame item);
  112.  
  113.   void removeFrame(in gfxIImageFrame item);
  114.  
  115.   /* notification when the current frame is done decoding */
  116.   void endFrameDecode(in unsigned long framenumber, in unsigned long timeout);
  117.   
  118.   /* notification that the entire image has been decoded */
  119.   void decodingComplete();
  120.   
  121.   void clear();
  122.  
  123.   void startAnimation();
  124.  
  125.   void stopAnimation();
  126.  
  127.   void resetAnimation();
  128.  
  129.   /* animation stuff */
  130.  
  131.   /**
  132.    * number of times to loop the image.
  133.    * @note -1 means forever.
  134.    */
  135.   attribute long loopCount;
  136. };
  137.